1. Field of the Invention
The present invention relates generally to producing computer generated images, and more specifically, to computing pixel values for said images.
2. Related Art
Computer graphics processing algorithms can be categorized into two principal methods: ray tracing and rasterization. Almost all modern computer graphics cards implement the rasterization method. This method is characterized by a “graphics pipeline,” that dictates how three-dimensional geometric data as well as two-dimensional pixel data are processed to ultimately be displayed in a frame buffer. For each geometric primitive, the corresponding geometric data enters a transformation stage and is transformed into fragments. Those fragments, and their corresponding pixel data, are rasterized to compute a final pixel color. This version of the pipeline is commonly called the “fixed-function pipeline.”
Recent generations of graphics processors have diverged from the fixed-function pipeline model. In these implementations, the fixed order of functions performed by either the transformation or rasterization stages is replaced by a user-defined, computer program, commonly termed a shader. However, conventional “programmable pipelines” suffer from substantial limitations. For example, during the rasterization stage, a single shader for coloring a pixel must perform all color computations for said pixel. Therefore, if pixels share common color computations that are invariant between separate pixels and computed identically inside of the shader program, the current shader architecture forces those computations to be redundantly computed. A similar situation exists in the processing of vertices by the transformation stage of the graphics pipeline.
User modifications of shader programs impose another limitation on conventional programmable pipelines. For instance, if a pixel shader is programmed to perform multiple operations, these operations are combined within the code of a single pixel shader, so that all color computations are processed, as discussed. If a user subsequently decides to modify one or more of these multiple operations, the user must re-write the code for the “single” pixel shader to alter the corresponding subroutine for each modified operation. The entire shader program (with the altered subroutine(s)) must be downloaded to a graphics card and executed to implement the modified operation(s). If the amount of time required for either constructing or downloading a program is proportional to the program's length, making a tiny change to one aspect of the rasterization process induces a penalty of the combined length of all the operations.
Therefore, a need exists to develop a technology that addresses these concerns and facilitates the ability to generate graphics in a timely and cost effective manner.